require 'observerext'

class Person
  include Observer #include the observer related methods
  observable :name,:address # the metavoodoo to create the accessor methods and fire events
end


admin=Person.new
admin.name='vagmi'
admin.address='admin@somesite.com'

# first observer 
admin.observe :name do |old,newvalue|
  puts %{The administrator changed from #{old} to #{newvalue}}
end

# the second observer
admin.observe :name do |old,newvalue|
	puts 'there can be multiple observers'
end

admin.name='root'
